package com.example.springboot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.springboot.common.Result;
import com.example.springboot.entity.UserRole;
import com.example.springboot.mapper.UserRoleMapper;
import com.example.springboot.service.UserRoleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author linyue
 * @since 2024-04-25
 */
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {

    @Override
    public Result selectByUser(String username) {
        List<UserRole> userRoles = list(new LambdaQueryWrapper<UserRole>().eq(UserRole::getUserName, username));
        return Result.success(userRoles);
    }
}
